<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<meta charset="UTF-8">
	<title>图表</title>
	<!-- 引入echarts.js -->
	<script  type="text/javascript" src="${ctxStatic}/echarts/echarts.min.js"></script>
</head>
<body>
<!-- 为Echarts准备一个具备大小(宽高)的dom -->
	<div id="main" style="height: 450px;width: 780px; margin: 10px auto 0 auto;">
	    
	</div>
	<script type="text/javascript">
	// 基于准备好的dom,初始化echarts实例
	var str = '${ss}'.split("_");
	var myChart = echarts.init(document.getElementById('main'));
	// 指定图标配置项数据
	var option = {
		// 标题
		title:{
			text:'${sttr}'
		},
		//工具箱
		toolbox: {
        show: true,
        feature: {
            dataZoom: {
                yAxisIndex: 'none'
            },
            dataView: {readOnly: true},
            magicType: {type: ['line', 'bar']}
        }
    },
		// 图列
		legend:{
			data:['数量']
		},
		//x轴
		xAxis:{
			data:["领取/购进","下发/售出","下级退回","退回上级","报废","库存盘盈","库存盘亏","当前库存"],
			axisLabel:{
              rotate:45, //刻度旋转45度角
              textStyle:{
              	fontSize:12 
           		}
			}
		},
		// y轴
		yAxis:{},
		//数据
		series:[{
			name:"数量",
			type:"bar",
			data:str,
			barWidth : 36,
		}],
		label:{ 
			normal:{ 
			show: true, 
			position: 'top'} 
		},
	};

// 使用刚刚指定的配置项和数据显示图表
myChart.setOption(option);
	</script>

</body>
</html>